home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / INSERT HEADER 4.SCRIPT < prev    next >
Encoding:
Text File  |  1998-02-20  |  883 b   |  33 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: insert Header 4~wraps the current selection with 
  6. <H4> ... </H4> tags. 
  7. @EndTool: 
  8. @Summary: insert Header 4~wraps selection with the H4 tag
  9. */
  10.  
  11. function DoCommand()
  12. {
  13.   var editor = getActiveEditor();
  14.   if (editor)
  15.   {
  16.     var selection = editor.getSelection();
  17.     var upperCaseHtmlTags = getMapFileValue("Preferences", "Upper Case HTML Tags", true);
  18.     if(upperCaseHtmlTags)
  19.     {
  20.       editor.insert(selection.endLineIndex, selection.endCharIndex, "</H4>");
  21.       editor.insert(selection.startLineIndex, selection.startCharIndex, "<H4>");
  22.     }
  23.     else
  24.     {
  25.       editor.insert(selection.endLineIndex, selection.endCharIndex, "</h4>");
  26.       editor.insert(selection.startLineIndex, selection.startCharIndex, "<h4>");
  27.     }
  28.     editor.setActive();
  29.   }
  30. }
  31.  
  32. !!/Script
  33.